<script setup lang="ts">
import { useGeneralDataStore } from './store/generalData'
import { fetchDomainAPI } from './apis/fetchDomain'

const generalDataStore = useGeneralDataStore()

onLaunch(async () => {
  const res = await fetchDomainAPI()
  if (res.data?.code === 1) {
    initHttpInstance(res.data?.data)
    await generalDataStore.update()
  }
  else { uni.showToast({ title: '数据获取失败', icon: 'none' }) }
})
</script>

<style>
view, input {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

button {
  margin: 0;
  padding: 0;
}

button::after {
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.skeleton {
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, .5) 50%,
    rgba(255, 255, 255, 0) 80%
  ) #D9D9D9;
  background-size: 200% 100%;
  background-position-x: 180%;
  animation: 1s loading ease-in-out infinite;
}

@keyframes loading {
  to {
    background-position-x: -20%;
  }
}

.uv-form-item__body__right__message {
  margin: 0 40rpx !important;
}
</style>
